<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tinyOS: tTask.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">tinyOS
   &#160;<span id="projectnumber">v1.00</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('t_task_8c_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">tTask.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="t_task_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="tiny_o_s_8h.html">tinyOS.h</a>&quot;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga639ee038febea3c977d37585fcc8a573">   23</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga639ee038febea3c977d37585fcc8a573">tTaskInit</a> (<a class="code" href="struct__t_task.html">tTask</a> *task, <span class="keywordtype">void</span> (*entry) (<span class="keywordtype">void</span> *), <span class="keywordtype">void</span> *param, uint32_t prio, uint32_t *stack, uint32_t size) {</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    uint32_t *stackTop;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="comment">// 为了简化代码，tinyOS无论是在启动时切换至第一个任务，还是在运行过程中在不同间任务切换</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <span class="comment">// 所执行的操作都是先保存当前任务的运行环境参数（CPU寄存器值）的堆栈中(如果已经运行运行起来的话)，然后再</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <span class="comment">// 取出从下一个任务的堆栈中取出之前的运行环境参数，然后恢复到CPU寄存器</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <span class="comment">// 对于切换至之前从没有运行过的任务，我们为它配置一个“虚假的”保存现场，然后使用该现场恢复。</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a57eb489f59ea6a56ccff2efea7f92c33">stackBase</a> = stack;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#ae20ace955faaa4fb797b69b75feef3d3">stackSize</a> = size;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    memset(stack, 0, size);</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    <span class="comment">// 注意以下两点：</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <span class="comment">// 1、不需要用到的寄存器，直接填了寄存器号，方便在IDE调试时查看效果；</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    <span class="comment">// 2、顺序不能变，要结合PendSV_Handler以及CPU对异常的处理流程来理解</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    stackTop = stack + size / <span class="keyword">sizeof</span>(<a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gad85a7244ee07814c23914d3cfcc91412">tTaskStack</a>);</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) (1 &lt;&lt; 24);               <span class="comment">// XPSR, 设置了Thumb模式，恢复到Thumb状态而非ARM状态运行</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) entry;                  <span class="comment">// 程序的入口地址</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) 0x14;                   <span class="comment">// R14(LR), 任务不会通过return xxx结束自己，所以未用</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) 0x12;                   <span class="comment">// R12, 未用</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) 0x3;                    <span class="comment">// R3, 未用</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) 0x2;                    <span class="comment">// R2, 未用</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) 0x1;                    <span class="comment">// R1, 未用</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) param;                  <span class="comment">// R0 = param, 传给任务的入口函数</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) 0x11;                   <span class="comment">// R11, 未用</span></div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) 0x10;                   <span class="comment">// R10, 未用</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) 0x9;                    <span class="comment">// R9, 未用</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) 0x8;                    <span class="comment">// R8, 未用</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) 0x7;                    <span class="comment">// R7, 未用</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) 0x6;                    <span class="comment">// R6, 未用</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) 0x5;                    <span class="comment">// R5, 未用</span></div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    *(--stackTop) = (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>) 0x4;                    <span class="comment">// R4, 未用</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a4fe7f19d35a11368d300b99348451fdd">slice</a> = TINYOS_SLICE_MAX;                     <span class="comment">// 初始化任务的时间片计数</span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a1abf78464029077a8080178b9e04745c">stack</a> = stackTop;                             <span class="comment">// 保存最终的值</span></div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a> = prio;                                  <span class="comment">// 设置任务的优先级</span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> = <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gae9796d3f7bdb820b16b7ca53a44bcbd0">TINYOS_TASK_STATE_RDY</a>;                <span class="comment">// 设置任务为就绪状态</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a70023864793bcef3ab18d4a66832ca6d">suspendCount</a> = 0;                             <span class="comment">// 初始挂起次数为0</span></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a9350eb6ea9f174b0711e8835a1543a87">clean</a> = (void (*) (<span class="keywordtype">void</span> *)) 0;                   <span class="comment">// 设置清理函数</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a365a4afcd9963180dadf380e9edde369">cleanParam</a> = (<span class="keywordtype">void</span> *) 0;                       <span class="comment">// 设置传递给清理函数的参数</span></div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a3b197900b58be56e296d46207dec079f">requestDeleteFlag</a> = 0;                        <span class="comment">// 请求删除标记</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a61a5517ac5c5a5149cf4b7d438e5c859">waitEvent</a> = (<a class="code" href="struct__t_event.html">tEvent</a> *) 0;                      <span class="comment">// 没有等待事件</span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#ae1ae004c581e0cc9fd22662535700001">eventMsg</a> = (<span class="keywordtype">void</span> *) 0;                         <span class="comment">// 没有等待事件</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a37707d87e42a484588393e5b3683ffbb">waitEventResult</a> = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a>;              <span class="comment">// 没有等待事件错误</span></div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <a class="code" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gae1557d8978ed3d8374e2ab3f0920c860">tNodeInit</a>(&amp;(task-&gt;<a class="code" href="struct__t_task.html#a069fafc88eadffde425a5d9fc895d85a">delayNode</a>));                      <span class="comment">// 初始化延时结点</span></div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <a class="code" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gae1557d8978ed3d8374e2ab3f0920c860">tNodeInit</a>(&amp;(task-&gt;<a class="code" href="struct__t_task.html#ab9a5b93b6f7bf200c776df8731d99133">linkNode</a>));                       <span class="comment">// 初始化链接结点</span></div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab7c2dfbda696e43a8c35ab97731837a0">tTaskSchedRdy</a>(task);                                <span class="comment">// 将任务插入就绪队列</span></div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="preprocessor">#if TINYOS_ENABLE_HOOKS == 1</span></div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <a class="code" href="group___hooks_xE6_x89_xA9_xE5_xB1_x95.html#ga7c4f462bd1d7e22836519312218b8f1e">tHooksTaskInit</a>(task);</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;}</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga9b1df557da8292af30d6ff42b48e0755">   83</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga9b1df557da8292af30d6ff42b48e0755">tTaskSuspend</a> (<a class="code" href="struct__t_task.html">tTask</a> *task) {</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <span class="comment">// 进入临界区</span></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <span class="comment">// 不允许对已经进入延时状态的任务挂起</span></div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keywordflow">if</span> (!(task-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> &amp; <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga1a73506e326a6f9a58f3a07172c400a3">TINYOS_TASK_STATE_DELAYED</a>)) {</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        <span class="comment">// 增加挂起计数，仅当该任务被执行第一次挂起操作时，才考虑是否</span></div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        <span class="comment">// 要执行任务切换操作</span></div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        <span class="keywordflow">if</span> (++task-&gt;<a class="code" href="struct__t_task.html#a70023864793bcef3ab18d4a66832ca6d">suspendCount</a> &lt;= 1) {</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;            <span class="comment">// 设置挂起标志</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;            task-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> |= <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gadec95d3273fe8be8c4018c9da38ebbc2">TINYOS_TASK_STATE_SUSPEND</a>;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;            <span class="comment">// 挂起方式很简单，就是将其从就绪队列中移除，这样调度器就不会发现他</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;            <span class="comment">// 也就没法切换到该任务运行</span></div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f3aa47609478099b79d1520a9baf9b3">tTaskSchedUnRdy</a>(task);</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;            <span class="comment">// 当然，这个任务可能是自己，那么就切换到其它任务</span></div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;            <span class="keywordflow">if</span> (task == <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>) {</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;                <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e">tTaskSched</a>();</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;            }</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        }</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    }</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="comment">// 退出临界区</span></div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;}</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gac08bc12c30a810c1ec5c48f330fd509a">  114</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gac08bc12c30a810c1ec5c48f330fd509a">tTaskWakeUp</a> (<a class="code" href="struct__t_task.html">tTask</a> *task) {</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="comment">// 进入临界区</span></div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="comment">// 检查任务是否处于挂起状态</span></div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="keywordflow">if</span> (task-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> &amp; <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gadec95d3273fe8be8c4018c9da38ebbc2">TINYOS_TASK_STATE_SUSPEND</a>) {</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="comment">// 递减挂起计数，如果为0了，则清除挂起标志，同时设置进入就绪状态</span></div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        <span class="keywordflow">if</span> (--task-&gt;<a class="code" href="struct__t_task.html#a70023864793bcef3ab18d4a66832ca6d">suspendCount</a> == 0) {</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;            <span class="comment">// 清除挂起标志</span></div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;            task-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> &amp;= ~<a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gadec95d3273fe8be8c4018c9da38ebbc2">TINYOS_TASK_STATE_SUSPEND</a>;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;            <span class="comment">// 同时将任务放回就绪队列中</span></div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab7c2dfbda696e43a8c35ab97731837a0">tTaskSchedRdy</a>(task);</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;            <span class="comment">// 唤醒过程中，可能有更高优先级的任务就绪，执行一次任务调度</span></div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e">tTaskSched</a>();</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;        }</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    }</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="comment">// 退出临界区</span></div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;}</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gae626b5c34d62e915c83dabcd77987ddd">  143</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gae626b5c34d62e915c83dabcd77987ddd">tTaskSetCleanCallFunc</a> (<a class="code" href="struct__t_task.html">tTask</a> *task, <span class="keywordtype">void</span> (*clean) (<span class="keywordtype">void</span> *param), <span class="keywordtype">void</span> *param) {</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a9350eb6ea9f174b0711e8835a1543a87">clean</a> = clean;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a365a4afcd9963180dadf380e9edde369">cleanParam</a> = param;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;}</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gad4f55f0276a954401641c0972f0020e3">  152</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gad4f55f0276a954401641c0972f0020e3">tTaskForceDelete</a> (<a class="code" href="struct__t_task.html">tTask</a> *task) {</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="comment">// 进入临界区</span></div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    <span class="comment">// 如果任务处于延时状态，则从延时队列中删除</span></div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="keywordflow">if</span> (task-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> &amp; <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga1a73506e326a6f9a58f3a07172c400a3">TINYOS_TASK_STATE_DELAYED</a>) {</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga691c421f369dba6c9e2015076262d377">tTimeTaskRemove</a>(task);</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    }</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        <span class="comment">// 如果任务不处于挂起状态，那么就是就绪态，从就绪表中删除</span></div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!(task-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> &amp; <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gadec95d3273fe8be8c4018c9da38ebbc2">TINYOS_TASK_STATE_SUSPEND</a>)) {</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gae85f17694aea45697d37b787702822ad">tTaskSchedRemove</a>(task);</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    }</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="comment">// 删除时，如果有设置清理函数，则调用清理函数</span></div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    <span class="keywordflow">if</span> (task-&gt;<a class="code" href="struct__t_task.html#a9350eb6ea9f174b0711e8835a1543a87">clean</a>) {</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;        task-&gt;<a class="code" href="struct__t_task.html#a9350eb6ea9f174b0711e8835a1543a87">clean</a>(task-&gt;<a class="code" href="struct__t_task.html#a365a4afcd9963180dadf380e9edde369">cleanParam</a>);</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    }</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <span class="comment">// 如果删除的是自己，那么需要切换至另一个任务，所以执行一次任务调度</span></div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a> == task) {</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e">tTaskSched</a>();</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    }</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    <span class="comment">// 退出临界区</span></div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;}</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;</div><div class="line"><a name="l00183"></a><span class="lineno"><a class="line" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga0e06a0c4378977bc86236ac4e61ae10e">  183</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga0e06a0c4378977bc86236ac4e61ae10e">tTaskRequestDelete</a> (<a class="code" href="struct__t_task.html">tTask</a> *task) {</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="comment">// 进入临界区</span></div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    <span class="comment">// 设置清除删除标记</span></div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a3b197900b58be56e296d46207dec079f">requestDeleteFlag</a> = 1;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    <span class="comment">// 退出临界区</span></div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;}</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;</div><div class="line"><a name="l00199"></a><span class="lineno"><a class="line" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga113466abdb6e224bd4da771809432819">  199</a></span>&#160;uint8_t <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga113466abdb6e224bd4da771809432819">tTaskIsRequestedDelete</a> (<span class="keywordtype">void</span>) {</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    uint8_t <span class="keyword">delete</span>;</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    <span class="comment">// 进入临界区</span></div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    <span class="comment">// 获取请求删除标记</span></div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    <span class="keyword">delete</span> = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a3b197900b58be56e296d46207dec079f">requestDeleteFlag</a>;</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;    <span class="comment">// 退出临界区</span></div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">delete</span>;</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;}</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;</div><div class="line"><a name="l00217"></a><span class="lineno"><a class="line" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga7e75a9fc2e7d9ca0bf62d519db50de00">  217</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga7e75a9fc2e7d9ca0bf62d519db50de00">tTaskDeleteSelf</a> (<span class="keywordtype">void</span>) {</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    <span class="comment">// 进入临界区</span></div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="comment">// 任务在调用该函数时，必须是处于就绪状态，不可能处于延时或挂起等其它状态</span></div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    <span class="comment">// 所以，只需要从就绪队列中移除即可</span></div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gae85f17694aea45697d37b787702822ad">tTaskSchedRemove</a>(<a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>);</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <span class="comment">// 删除时，如果有设置清理函数，则调用清理函数</span></div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a9350eb6ea9f174b0711e8835a1543a87">clean</a>) {</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a9350eb6ea9f174b0711e8835a1543a87">clean</a>(<a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a365a4afcd9963180dadf380e9edde369">cleanParam</a>);</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    }</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    <span class="comment">// 接下来，肯定是切换到其它任务去运行</span></div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e">tTaskSched</a>();</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    <span class="comment">// 退出临界区</span></div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;}</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;</div><div class="line"><a name="l00242"></a><span class="lineno"><a class="line" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga5713566b36243903f668bd8ecfd41f71">  242</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga5713566b36243903f668bd8ecfd41f71">tTaskGetInfo</a> (<a class="code" href="struct__t_task.html">tTask</a> *task, <a class="code" href="struct__t_task_info.html">tTaskInfo</a> *info) {</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    uint32_t *stackEnd;</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;    <span class="comment">// 进入临界区</span></div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    info-&gt;<a class="code" href="struct__t_task_info.html#a0c1ef2b42e60232fd2355246df290c68">delayTicks</a> = task-&gt;<a class="code" href="struct__t_task.html#a0c1ef2b42e60232fd2355246df290c68">delayTicks</a>;                <span class="comment">// 延时信息</span></div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    info-&gt;<a class="code" href="struct__t_task_info.html#a6871573fefee3ad102e26a09e7a2f493">prio</a> = task-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a>;                            <span class="comment">// 任务优先级</span></div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;    info-&gt;<a class="code" href="struct__t_task_info.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> = task-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a>;                          <span class="comment">// 任务状态</span></div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    info-&gt;<a class="code" href="struct__t_task_info.html#a4fe7f19d35a11368d300b99348451fdd">slice</a> = task-&gt;<a class="code" href="struct__t_task.html#a4fe7f19d35a11368d300b99348451fdd">slice</a>;                          <span class="comment">// 剩余时间片</span></div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    info-&gt;<a class="code" href="struct__t_task_info.html#a70023864793bcef3ab18d4a66832ca6d">suspendCount</a> = task-&gt;<a class="code" href="struct__t_task.html#a70023864793bcef3ab18d4a66832ca6d">suspendCount</a>;            <span class="comment">// 被挂起的次数</span></div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    info-&gt;<a class="code" href="struct__t_task_info.html#ae20ace955faaa4fb797b69b75feef3d3">stackSize</a> = task-&gt;<a class="code" href="struct__t_task.html#ae20ace955faaa4fb797b69b75feef3d3">stackSize</a>;</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;    <span class="comment">// 计算堆栈使用量</span></div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    info-&gt;<a class="code" href="struct__t_task_info.html#ab8b8202c533d50459f39dfab24e8873d">stackFree</a> = 0;</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;    stackEnd = task-&gt;<a class="code" href="struct__t_task.html#a57eb489f59ea6a56ccff2efea7f92c33">stackBase</a>;</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;    <span class="keywordflow">while</span> ((*stackEnd++ == 0) &amp;&amp; (stackEnd &lt;= task-&gt;stackBase + task-&gt;<a class="code" href="struct__t_task.html#ae20ace955faaa4fb797b69b75feef3d3">stackSize</a> / <span class="keyword">sizeof</span>(<a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gad85a7244ee07814c23914d3cfcc91412">tTaskStack</a>))) {</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;        info-&gt;<a class="code" href="struct__t_task_info.html#ab8b8202c533d50459f39dfab24e8873d">stackFree</a>++;</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;    }</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;    <span class="comment">// 转换成字节数</span></div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;    info-&gt;<a class="code" href="struct__t_task_info.html#ab8b8202c533d50459f39dfab24e8873d">stackFree</a> *= <span class="keyword">sizeof</span>(<a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gad85a7244ee07814c23914d3cfcc91412">tTaskStack</a>);</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    <span class="comment">// 退出临界区</span></div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;}</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;</div><div class="ttc" id="struct__t_task_info_html_ae20ace955faaa4fb797b69b75feef3d3"><div class="ttname"><a href="struct__t_task_info.html#ae20ace955faaa4fb797b69b75feef3d3">_tTaskInfo::stackSize</a></div><div class="ttdeci">uint32_t stackSize</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00071">tTask.h:71</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_ga691c421f369dba6c9e2015076262d377"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga691c421f369dba6c9e2015076262d377">tTimeTaskRemove</a></div><div class="ttdeci">void tTimeTaskRemove(tTask *task)</div><div class="ttdoc">将延时的任务从延时队列中移除 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00189">tCore.c:189</a></div></div>
<div class="ttc" id="struct__t_task_html_a1abf78464029077a8080178b9e04745c"><div class="ttname"><a href="struct__t_task.html#a1abf78464029077a8080178b9e04745c">_tTask::stack</a></div><div class="ttdeci">uint32_t * stack</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00036">tTask.h:36</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_ga1a73506e326a6f9a58f3a07172c400a3"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga1a73506e326a6f9a58f3a07172c400a3">TINYOS_TASK_STATE_DELAYED</a></div><div class="ttdeci">#define TINYOS_TASK_STATE_DELAYED</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00019">tTask.h:19</a></div></div>
<div class="ttc" id="struct__t_task_html"><div class="ttname"><a href="struct__t_task.html">_tTask</a></div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00031">tTask.h:31</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_gad85a7244ee07814c23914d3cfcc91412"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gad85a7244ee07814c23914d3cfcc91412">tTaskStack</a></div><div class="ttdeci">uint32_t tTaskStack</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00025">tTask.h:25</a></div></div>
<div class="ttc" id="struct__t_task_html_ae1ae004c581e0cc9fd22662535700001"><div class="ttname"><a href="struct__t_task.html#ae1ae004c581e0cc9fd22662535700001">_tTask::eventMsg</a></div><div class="ttdeci">void * eventMsg</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00058">tTask.h:58</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gae85f17694aea45697d37b787702822ad"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gae85f17694aea45697d37b787702822ad">tTaskSchedRemove</a></div><div class="ttdeci">void tTaskSchedRemove(tTask *task)</div><div class="ttdoc">将任务从就绪列表中移除 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00115">tCore.c:115</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_gae626b5c34d62e915c83dabcd77987ddd"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gae626b5c34d62e915c83dabcd77987ddd">tTaskSetCleanCallFunc</a></div><div class="ttdeci">void tTaskSetCleanCallFunc(tTask *task, void(*clean)(void *param), void *param)</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8c_source.html#l00143">tTask.c:143</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_ga7e75a9fc2e7d9ca0bf62d519db50de00"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga7e75a9fc2e7d9ca0bf62d519db50de00">tTaskDeleteSelf</a></div><div class="ttdeci">void tTaskDeleteSelf(void)</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8c_source.html#l00217">tTask.c:217</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gab4d6c802c474b9071f48312bed3dec74"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a></div><div class="ttdeci">tTaskCritical_t tTaskEnterCritical(void)</div><div class="ttdef"><b>Definition:</b> <a href="t_switch_8c_source.html#l00036">tSwitch.c:36</a></div></div>
<div class="ttc" id="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8_html_gae1557d8978ed3d8374e2ab3f0920c860"><div class="ttname"><a href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gae1557d8978ed3d8374e2ab3f0920c860">tNodeInit</a></div><div class="ttdeci">void tNodeInit(tNode *node)</div><div class="ttdef"><b>Definition:</b> <a href="t_list_8c_source.html#l00019">tList.c:19</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_ga9b1df557da8292af30d6ff42b48e0755"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga9b1df557da8292af30d6ff42b48e0755">tTaskSuspend</a></div><div class="ttdeci">void tTaskSuspend(tTask *task)</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8c_source.html#l00083">tTask.c:83</a></div></div>
<div class="ttc" id="struct__t_task_html_a61a5517ac5c5a5149cf4b7d438e5c859"><div class="ttname"><a href="struct__t_task.html#a61a5517ac5c5a5149cf4b7d438e5c859">_tTask::waitEvent</a></div><div class="ttdeci">struct _tEvent * waitEvent</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00057">tTask.h:57</a></div></div>
<div class="ttc" id="struct__t_task_info_html_a6871573fefee3ad102e26a09e7a2f493"><div class="ttname"><a href="struct__t_task_info.html#a6871573fefee3ad102e26a09e7a2f493">_tTaskInfo::prio</a></div><div class="ttdeci">uint32_t prio</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00067">tTask.h:67</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gaeb48f2b93febc962f23d9a6a72db9d8e"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e">tTaskSched</a></div><div class="ttdeci">void tTaskSched(void)</div><div class="ttdoc">任务调度接口。通过它来选择下一个具体的任务，然后切换至该任务运行。 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00126">tCore.c:126</a></div></div>
<div class="ttc" id="struct__t_task_html_a365a4afcd9963180dadf380e9edde369"><div class="ttname"><a href="struct__t_task.html#a365a4afcd9963180dadf380e9edde369">_tTask::cleanParam</a></div><div class="ttdeci">void * cleanParam</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00053">tTask.h:53</a></div></div>
<div class="ttc" id="struct__t_task_info_html_a70023864793bcef3ab18d4a66832ca6d"><div class="ttname"><a href="struct__t_task_info.html#a70023864793bcef3ab18d4a66832ca6d">_tTaskInfo::suspendCount</a></div><div class="ttdeci">uint32_t suspendCount</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00070">tTask.h:70</a></div></div>
<div class="ttc" id="struct__t_task_html_a3b197900b58be56e296d46207dec079f"><div class="ttname"><a href="struct__t_task.html#a3b197900b58be56e296d46207dec079f">_tTask::requestDeleteFlag</a></div><div class="ttdeci">uint8_t requestDeleteFlag</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00054">tTask.h:54</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_ga639ee038febea3c977d37585fcc8a573"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga639ee038febea3c977d37585fcc8a573">tTaskInit</a></div><div class="ttdeci">void tTaskInit(tTask *task, void(*entry)(void *), void *param, uint32_t prio, uint32_t *stack, uint32_t size)</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8c_source.html#l00023">tTask.c:23</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_gadec95d3273fe8be8c4018c9da38ebbc2"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gadec95d3273fe8be8c4018c9da38ebbc2">TINYOS_TASK_STATE_SUSPEND</a></div><div class="ttdeci">#define TINYOS_TASK_STATE_SUSPEND</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00020">tTask.h:20</a></div></div>
<div class="ttc" id="struct__t_event_html"><div class="ttname"><a href="struct__t_event.html">_tEvent</a></div><div class="ttdef"><b>Definition:</b> <a href="t_event_8h_source.html#l00032">tEvent.h:32</a></div></div>
<div class="ttc" id="tiny_o_s_8h_html"><div class="ttname"><a href="tiny_o_s_8h.html">tinyOS.h</a></div></div>
<div class="ttc" id="struct__t_task_html_a70023864793bcef3ab18d4a66832ca6d"><div class="ttname"><a href="struct__t_task.html#a70023864793bcef3ab18d4a66832ca6d">_tTask::suspendCount</a></div><div class="ttdeci">uint32_t suspendCount</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00050">tTask.h:50</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_ga0e06a0c4378977bc86236ac4e61ae10e"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga0e06a0c4378977bc86236ac4e61ae10e">tTaskRequestDelete</a></div><div class="ttdeci">void tTaskRequestDelete(tTask *task)</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8c_source.html#l00183">tTask.c:183</a></div></div>
<div class="ttc" id="group___hooks_xE6_x89_xA9_xE5_xB1_x95_html_ga7c4f462bd1d7e22836519312218b8f1e"><div class="ttname"><a href="group___hooks_xE6_x89_xA9_xE5_xB1_x95.html#ga7c4f462bd1d7e22836519312218b8f1e">tHooksTaskInit</a></div><div class="ttdeci">void tHooksTaskInit(tTask *task)</div></div>
<div class="ttc" id="struct__t_task_html_a9350eb6ea9f174b0711e8835a1543a87"><div class="ttname"><a href="struct__t_task.html#a9350eb6ea9f174b0711e8835a1543a87">_tTask::clean</a></div><div class="ttdeci">void(* clean)(void *param)</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00052">tTask.h:52</a></div></div>
<div class="ttc" id="struct__t_task_html_a4fe7f19d35a11368d300b99348451fdd"><div class="ttname"><a href="struct__t_task.html#a4fe7f19d35a11368d300b99348451fdd">_tTask::slice</a></div><div class="ttdeci">uint32_t slice</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00048">tTask.h:48</a></div></div>
<div class="ttc" id="struct__t_task_html_a069fafc88eadffde425a5d9fc895d85a"><div class="ttname"><a href="struct__t_task.html#a069fafc88eadffde425a5d9fc895d85a">_tTask::delayNode</a></div><div class="ttdeci">tNode delayNode</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00043">tTask.h:43</a></div></div>
<div class="ttc" id="struct__t_task_info_html"><div class="ttname"><a href="struct__t_task_info.html">_tTaskInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00065">tTask.h:65</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_ga21b4efbc4cb710d7d0e71678d2b13e53"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a></div><div class="ttdeci">void tTaskExitCritical(tTaskCritical_t status)</div><div class="ttdef"><b>Definition:</b> <a href="t_switch_8c_source.html#l00047">tSwitch.c:47</a></div></div>
<div class="ttc" id="struct__t_task_html_a6871573fefee3ad102e26a09e7a2f493"><div class="ttname"><a href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">_tTask::prio</a></div><div class="ttdeci">uint32_t prio</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00045">tTask.h:45</a></div></div>
<div class="ttc" id="struct__t_task_html_a57eb489f59ea6a56ccff2efea7f92c33"><div class="ttname"><a href="struct__t_task.html#a57eb489f59ea6a56ccff2efea7f92c33">_tTask::stackBase</a></div><div class="ttdeci">uint32_t * stackBase</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00037">tTask.h:37</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_gae9796d3f7bdb820b16b7ca53a44bcbd0"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gae9796d3f7bdb820b16b7ca53a44bcbd0">TINYOS_TASK_STATE_RDY</a></div><div class="ttdeci">#define TINYOS_TASK_STATE_RDY</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00017">tTask.h:17</a></div></div>
<div class="ttc" id="struct__t_task_info_html_a0c1ef2b42e60232fd2355246df290c68"><div class="ttname"><a href="struct__t_task_info.html#a0c1ef2b42e60232fd2355246df290c68">_tTaskInfo::delayTicks</a></div><div class="ttdeci">uint32_t delayTicks</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00066">tTask.h:66</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_ga5713566b36243903f668bd8ecfd41f71"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga5713566b36243903f668bd8ecfd41f71">tTaskGetInfo</a></div><div class="ttdeci">void tTaskGetInfo(tTask *task, tTaskInfo *info)</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8c_source.html#l00242">tTask.c:242</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gab7c2dfbda696e43a8c35ab97731837a0"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab7c2dfbda696e43a8c35ab97731837a0">tTaskSchedRdy</a></div><div class="ttdeci">void tTaskSchedRdy(tTask *task)</div><div class="ttdoc">将任务设置为就绪状态 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00093">tCore.c:93</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_gad4f55f0276a954401641c0972f0020e3"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gad4f55f0276a954401641c0972f0020e3">tTaskForceDelete</a></div><div class="ttdeci">void tTaskForceDelete(tTask *task)</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8c_source.html#l00152">tTask.c:152</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a></div><div class="ttdef"><b>Definition:</b> <a href="tiny_o_s_8h_source.html#l00034">tinyOS.h:34</a></div></div>
<div class="ttc" id="struct__t_task_html_a1b0c7bd4d79798ef4e0ce23894c9aeb2"><div class="ttname"><a href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">_tTask::state</a></div><div class="ttdeci">uint32_t state</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00047">tTask.h:47</a></div></div>
<div class="ttc" id="struct__t_task_html_ab9a5b93b6f7bf200c776df8731d99133"><div class="ttname"><a href="struct__t_task.html#ab9a5b93b6f7bf200c776df8731d99133">_tTask::linkNode</a></div><div class="ttdeci">tNode linkNode</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00040">tTask.h:40</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_ga6f232fb9d8361d1071e4f621468e0ee1"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a></div><div class="ttdeci">tTask * currentTask</div><div class="ttdoc">当前任务：记录当前是哪个任务正在运行 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00017">tCore.c:17</a></div></div>
<div class="ttc" id="struct__t_task_info_html_a4fe7f19d35a11368d300b99348451fdd"><div class="ttname"><a href="struct__t_task_info.html#a4fe7f19d35a11368d300b99348451fdd">_tTaskInfo::slice</a></div><div class="ttdeci">uint32_t slice</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00069">tTask.h:69</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_gac08bc12c30a810c1ec5c48f330fd509a"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gac08bc12c30a810c1ec5c48f330fd509a">tTaskWakeUp</a></div><div class="ttdeci">void tTaskWakeUp(tTask *task)</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8c_source.html#l00114">tTask.c:114</a></div></div>
<div class="ttc" id="struct__t_task_html_a0c1ef2b42e60232fd2355246df290c68"><div class="ttname"><a href="struct__t_task.html#a0c1ef2b42e60232fd2355246df290c68">_tTask::delayTicks</a></div><div class="ttdeci">uint32_t delayTicks</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00042">tTask.h:42</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_ga6f3aa47609478099b79d1520a9baf9b3"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f3aa47609478099b79d1520a9baf9b3">tTaskSchedUnRdy</a></div><div class="ttdeci">void tTaskSchedUnRdy(tTask *task)</div><div class="ttdoc">将任务从就绪列表中移除 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00102">tCore.c:102</a></div></div>
<div class="ttc" id="struct__t_task_info_html_ab8b8202c533d50459f39dfab24e8873d"><div class="ttname"><a href="struct__t_task_info.html#ab8b8202c533d50459f39dfab24e8873d">_tTaskInfo::stackFree</a></div><div class="ttdeci">uint32_t stackFree</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00072">tTask.h:72</a></div></div>
<div class="ttc" id="struct__t_task_html_ae20ace955faaa4fb797b69b75feef3d3"><div class="ttname"><a href="struct__t_task.html#ae20ace955faaa4fb797b69b75feef3d3">_tTask::stackSize</a></div><div class="ttdeci">uint32_t stackSize</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00039">tTask.h:39</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_ga113466abdb6e224bd4da771809432819"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#ga113466abdb6e224bd4da771809432819">tTaskIsRequestedDelete</a></div><div class="ttdeci">uint8_t tTaskIsRequestedDelete(void)</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8c_source.html#l00199">tTask.c:199</a></div></div>
<div class="ttc" id="struct__t_task_info_html_a1b0c7bd4d79798ef4e0ce23894c9aeb2"><div class="ttname"><a href="struct__t_task_info.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">_tTaskInfo::state</a></div><div class="ttdeci">uint32_t state</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00068">tTask.h:68</a></div></div>
<div class="ttc" id="struct__t_task_html_a37707d87e42a484588393e5b3683ffbb"><div class="ttname"><a href="struct__t_task.html#a37707d87e42a484588393e5b3683ffbb">_tTask::waitEventResult</a></div><div class="ttdeci">uint32_t waitEventResult</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00059">tTask.h:59</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="t_task_8c.html">tTask.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
